package com.example.stray_animal_management_system.util;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: panpan
 * @time: 2025/11/9
 */
public class LogReader {

    private static final String LOG_FILE_PATH = "D:/Universitystudy/springbootsoft/Maven/maven-repository/code/Stray_Animal_Management_System/target/classes/logs/springboot.log";  // 更改为你的日志路径

    public static List<String> readLogLines() {
        List<String> logLines = new ArrayList<>();
        try (BufferedReader reader = new BufferedReader(new FileReader(LOG_FILE_PATH))) {
            String line;
            while ((line = reader.readLine()) != null) {
                logLines.add(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return logLines;
    }
}